package com.app.web.stomp

import org.springframework.context.annotation.Configuration
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
/**
 * Created by three on 14-10-14.
 */
@Configuration
@EnableWebSecurity
class SecurityConfig extends WebSecurityConfigurerAdapter {

    /*@Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser("aaa").password("aaa").roles("USER");
        auth.inMemoryAuthentication().withUser("dan").password("dan").roles("USER");
        auth.inMemoryAuthentication().withUser("chris").password("chris").roles("USER");
    }
*/
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .inMemoryAuthentication()
                .withUser("aaa").password("aaa").roles("USER").and()
                .withUser("paulson").password("bond").roles("ADMIN","USER");
    }

}
